import request from '@/utils/request'
export default {
    // 根据课程ID获取章节和小节列表
    getAllChapterVideo(courseId) {
        return request({
            url: '/chapter/getChapterVideo/' + courseId,
            method: 'get'
        })
    },
    // 添加章节
    addChapter(chapter) {
        return request({
            url: '/chapter/addChapter',
            method: 'post',
            data: chapter
        })
    },
    // 根据章节id查询
    queryByChapterId(chapterId) {
        return request({
            url: '/chapter/queryByChapterId/' + chapterId,
            method: 'get'
        })
    },
    // 修改章节
    updateChapter(chapter) {
        return request({
            url: '/chapter/updateChapter',
            method: 'post',
            data: chapter
        })
    },
    // 根据ID删除章节
    deleteByChapterId(chapterId) {
        return request({
            url: '/chapter/' + chapterId,
            method: 'delete'
        })
    }
}